﻿@using Web7.Container.Html
@using System.Globalization
@{
    Layout = Html.GetMasterLayout();
    var currewnCuture = Request.Cookies["_culture"];
    var cultureInfos = CultureInfo.GetCultures(CultureTypes.SpecificCultures)
                    .OrderBy(t => t.IetfLanguageTag)
                    .Select(t => new SelectListItem
                                     {
                                         Text = t.EnglishName,
                                         Value = t.IetfLanguageTag,
                                         Selected =currewnCuture!=null && currewnCuture.Value.ToString(CultureInfo.InvariantCulture) == t.IetfLanguageTag

                                     });
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
</head>
<body>
    <div>
        @{
            Html.BeginForm("CultureChange", "Front", "Post");
        }
        @T("Admin.Language.Language.Choose"):
        @Html.DropDownList(@T("Choose").ToString(), cultureInfos, htmlAttributes: new { @onchange = "this.form.submit();" })
        @{
            Html.EndForm();
        }
    </div>
    <br />
    <br />
    <br />@RenderBody()<br />
    <br />
</body>
</html>
